package org.example;

import java.util.Scanner;

/**
 * @author hh
 * @since 2024/11/24
 */
public class LoginConsoleCommand implements BaseCommand{

    public static final String KEY = "1";
    private String username;
    private String password;

    @Override
    public void exec(Scanner scanner) {
        System.out.println("请输入用户信息(id:password)");
        String[] info = null;
        while (true) {
            String input = scanner.next();
            info = input.split(":");
            if (info.length != 2) {
                System.out.println("请按照格式输入(id:password):");
            } else {
                break;
            }
        }
        username = info[0];
        password = info[1];
    }
}
